package com.aspose.cells.a.d;

public class zel extends zef {
   private static float b = 14400.0F;
   private float c;
   private float d;
   private zew g;
   private zn h;
   private zo i;
   private zex j;
   private zeb k;
   private zen l;
   private zep m;
   private float n = 1.0F;

   public zel(zdh var1, float var2, float var3) throws Exception {
      super(var1);
      if (var1.b().o() == 0) {
         if (var2 > b * this.n) {
            this.n = (float)((int)(var2 / b + 1.0F));
         }

         if (var3 > b * this.n) {
            this.n = (float)((int)(var3 / b + 1.0F));
         }
      }

      this.c = var2 / this.n;
      this.d = var3 / this.n;
      this.g = new zew(this.e, false);
      this.l = new zen(this.g);
      this.j = new zex(this.e, this.g);
      this.k = new zeb(this.e, this.e.c(), this.g);
      this.e.i().a();
      this.e.i().a(new com.aspose.cells.b.a.b.a.zi(1.0F / this.n, 0.0F, 0.0F, -1.0F / this.n, 0.0F, this.d), this.g);
   }

   public void b() {
   }

   public void a(zb var1) throws Exception {
      this.a((zbg)var1);
   }

   public void b(zb var1) throws Exception {
      this.b((zbg)var1);
      if (var1.d() != null) {
         this.a(var1.d());
      }

   }

   public void a(zf var1) throws Exception {
      this.a((zbg)var1);
      this.j.a(var1);
      if (var1.m() != null) {
         this.a(var1.m());
      }

      this.b((zbg)var1);
   }

   public void a(zn var1) throws Exception {
      this.a((zbg)var1);
      if (var1.d() != null) {
         this.k.a(var1.d(), false);
      }

      if (var1.a != null) {
         this.k.a(var1.a);
      }

      this.h = var1;
   }

   public void b(zn var1) throws Exception {
      this.g.c(this.c());
      this.i = null;
      this.b((zbg)var1);
   }

   public void a(zo var1) throws Exception {
      if (this.d()) {
         this.g.c("h");
      }

      this.l.a(var1);
      this.i = var1;
   }

   public void b(zo var1) throws Exception {
      this.l.b(var1);
   }

   public void a(zq var1) throws Exception {
      this.l.a(var1);
   }

   public void a(zp var1) throws Exception {
      this.l.a(var1);
   }

   public void a(za var1) throws Exception {
      this.l.a(var1);
   }

   public void a(zj var1) throws Exception {
      assert var1 != null;

      if (var1.e() != 0) {
         com.aspose.cells.b.a.d.zh var2 = new com.aspose.cells.b.a.d.zh(var1.d());

         try {
            com.aspose.cells.b.a.b.za var3 = (com.aspose.cells.b.a.b.za)com.aspose.cells.b.a.b.za.a(var2);
            if (var3.c() != 2498570 && var3.c() != 139273) {
               var3 = zbn.a(var3);
               this.k.a(var3, var1.b(), var1.c(), var1.a());
            } else {
               this.k.a(var3, var1.b(), var1.c(), var1.a());
            }

            if (var1.g() != null) {
               this.a(var1.g());
            }
         } catch (Exception var4) {
            com.aspose.cells.a.c.zl.b(var4);
         }
      }

   }

   public void a(zeg var1) throws Exception {
      this.b(var1);
      this.g.a(var1);
   }

   private void b(zeg var1) throws Exception {
      var1.a(this);
      var1.g();
      var1.a("/Type", "/Page");
      var1.a("/Parent", this.e.d().n());
      var1.a("/Contents", this.g.n());
      var1.a("/MediaBox", new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, this.c, this.d));
      if (!this.e.b().u()) {
         var1.a("/Group", "<< /CS /DeviceRGB /S /Transparency /Type /Group >>");
      }

      if (this.m != null) {
         var1.a("/Annots");
         this.m.a(var1);
      }

      if (this.n > 1.0F) {
         var1.a("/UserUnit", this.n);
      }

      var1.a("/Resources");
      var1.g();
      this.e.c().a(var1, this.m());
      var1.h();
      var1.h();
      var1.b();
   }

   private void a(zbg var1) throws Exception {
      if (zaz.a(var1)) {
         this.e.i().a(this.g);
         if (zaz.c(var1)) {
            this.e.i().a(var1.a(), this.g);
         }

         if (zaz.d(var1)) {
            if (zaz.c(var1.b())) {
               this.e.i().a(var1.b().a(), this.g);
            }

            this.e.i().a(var1.b(), this.g);
            if (zaz.c(var1.b())) {
               com.aspose.cells.b.a.b.a.zi var2 = var1.b().a().b();
               var2.f();
               this.e.i().a(var2, this.g);
               var2 = null;
            }
         }
      }

   }

   private void b(zbg var1) throws Exception {
      if (zaz.a(var1)) {
         this.e.i().b(this.g);
      }

   }

   private String c() throws Exception {
      StringBuilder var1 = new StringBuilder();

      assert this.h.d() != null || this.h.a != null;

      if (this.h.d() != null && this.h.a != null) {
         var1.append(this.d() ? "b" : "B");
         if (this.h.e() == 0) {
            var1.append("*");
         }
      } else if (this.h.d() != null) {
         if (this.h.d() instanceof zg) {
            var1.append(" W  n ");
            zeu var2 = this.e.c().a(this.h.d());
            var2.b(this.m());
            var1.append("/" + var2.p() + " sh ");
         } else {
            var1.append("f");
            if (this.h.e() == 0) {
               var1.append("*");
            }
         }
      } else if (this.h.a != null) {
         var1.append(this.d() ? "s" : "S");
      }

      return com.aspose.cells.b.a.zr.a(var1);
   }

   public void a(zi var1) throws Exception {
      assert var1 != null;

      if (this.m == null) {
         this.m = new zep();
      }

      zdb var2 = new zdb(this.e, this.e.i().a(var1.a()), var1.c(), var1.b());
      this.m.add(var2.n());
      this.e.e().a(var2);
      this.e.e().a(var1.c(), var2.a());
   }

   private boolean d() {
      return this.i != null && this.i.b();
   }

   public void a(zk var1) throws Exception {
      this.e.i().a(this.g);
      this.k.a(var1.c);
      StringBuilder var2 = new StringBuilder(16);
      zfc.a(var1.a, var2);
      var2.append(" m");
      this.g.c(com.aspose.cells.b.a.zr.a(var2));
      var2.setLength(0);
      zfc.a(var1.b, var2);
      var2.append(" l");
      this.g.c(com.aspose.cells.b.a.zr.a(var2));
      this.g.c("S");
      this.e.i().b(this.g);
   }
}
